package o.gwtp.editor.client.welcome;

import o.gwtp.editor.client.main.MainPresenter;
import o.gwtp.editor.client.navigation.NavigationTabElement;

import com.google.inject.Inject;
import com.gwtplatform.mvp.client.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.NameToken;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
import com.gwtplatform.mvp.client.proxy.RevealContentEvent;

/**
 * @author Olivier Monaco
 * @author Christian Goudreau
 */
public class WelcomePresenter extends
    Presenter<WelcomePresenter.MyView, WelcomePresenter.MyProxy> implements
    NavigationTabElement {
  @NameToken("welcome")
  @ProxyStandard
  public interface MyProxy extends ProxyPlace<WelcomePresenter> {
  }

  public interface MyView extends View {
  }

  @Inject
  public WelcomePresenter(EventBus eventBus, MyView view, MyProxy proxy) {
    super(eventBus, view, proxy);
  }

  @Override
  public String getName() {
    return "Welcome";
  }

  @Override
  public String getToken() {
    return getProxy().getNameToken();
  }

  @Override
  public boolean isClosable() {
    return false;
  }

  @Override
  protected void revealInParent() {
    RevealContentEvent.fire(this, MainPresenter.CONTENT_SLOT, this);
  }
}
